#coding=gbk
import time
import queue

print(time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime()))

read_file = open("totototo.txt", "r", encoding='utf-8')
write_file = open("tototototo.txt", "a+", encoding='utf-8')

try:
    text_line = None
    schoolList=[]
    queueOne=queue.Queue()

    while True:
        text_line = read_file.readline()
        # print(text_line)
        if text_line:
            if text_line.split("[")[0]==text_line:
                line=text_line
            else:

                front= text_line.split("[")[0]
                end=text_line.split(",")
                l=len(end)
                want_end1=end[l-1]
                want_end2=end[l-2]
                line=front+","+want_end2+","+want_end1
            queueOne.put(line)
        else:
            break

    while queueOne.empty() != True:
        write_file.write(queueOne.get())


finally:
    write_file.close()
    read_file.close()






print(time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime()))
